package com.cloudlinkscm.base.filecenter.client.controller;

import com.cloudlinkscm.base.filecenter.client.FileClient;
import com.cloudlinkscm.base.filecenter.model.dto.DeleteRequestDto;
import com.cloudlinkscm.base.filecenter.model.dto.DocumentUploadDto;
import com.cloudlinkscm.base.filecenter.model.dto.DownloadRequestDto;
import com.cloudlinkscm.base.filecenter.model.dto.ImageUploadDto;
import com.cloudlinkscm.base.filecenter.service.FileRemoteService;
import com.cloudlinkscm.loms.framework.core.pojo.RestfulApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @author : tac
 * @date : 2017/7/25
 */

@RestController
@RequestMapping("fileClientTest")
public class FileClientTestController implements FileRemoteService {
    @Autowired
    private FileClient fileClient;

    @Override
    public RestfulApiResponse<Map<String, String>> documentUrls(DownloadRequestDto dto) {
        return fileClient.documentUrls(dto);
    }

    @Override
    public RestfulApiResponse<Map<String, String>> imageUrls(DownloadRequestDto dto) {
        return fileClient.imageUrls(dto);
    }

    @Override
    public RestfulApiResponse<String> uploadDocument(MultipartFile file, DocumentUploadDto args) {
        return fileClient.uploadDocument(file, args);
    }

    @Override
    public RestfulApiResponse<String> uploadImage(MultipartFile file, ImageUploadDto args) {
        return fileClient.uploadImage(file, args);
    }

    @Override
    public RestfulApiResponse<Integer> delete(DeleteRequestDto dto) {
        return fileClient.delete(dto);
    }
}